using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace Alogient.Cameleon.Forms.Sdk.Controls
{
    internal class CMFormElement : WebControl
    {
        public const string elementIDFormat = "element_{0}";
        public virtual string Value { get { return string.Empty; } }
        public virtual string[] Values { get { return null; } }
        protected int FormElementID = 0;

        protected override HtmlTextWriterTag TagKey
        {
            get
            {
                return HtmlTextWriterTag.Div;
            }
        }

        internal CMFormElement(Forms.Sdk.Items.FormElement element)
        {
            this.FormElementID = element.ID;
            this.ID = string.Format(elementIDFormat, element.ID.ToString());
        }

        protected void GenerateRow(Items.FormElement element, params Control[] contents)
        {
            foreach (Control content in contents)
            {       
                this.Controls.Add(content);
            }
           
            this.CssClass = element.CSS;
            this.ToolTip = element.ToolTip;
        }
    }
}
